<template>
    <div>{{name}}</div>
</template>

<script>
export default {
  data() {
    return {
      name: ""
    };
  },
  props: {
    value: {
      required: true
    },
    type: {
      type: String,
      required: true
    }
  },
  methods: {
    init() {
      this.$http({
        url: this.$http.adornUrl(`/sys/dict/typeValue`),
        method: "POST",
        params: this.$http.adornParams({
          value: this.value,
          type: this.type
        })
      }).then(({ data }) => {
        this.name = data.sysDictEntity.name;
      });
    }
  },
  mounted() {
    this.init();
  }
};
</script>

<style>
</style>